/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.inria.openmath.omapi;

/**
 *
 * @author Mr.Sam
 */
import java.io.*;
import java.math.BigInteger;
import java.util.Locale;
public interface Printer {

    /**
     * Puts begin of OpenMath object.
     *
     * <p>Prints the begining marker of a new OpenMath object on output.
     * Must be called each time a new OpenMath object is to be printed.
     * (Not before every token!)
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putBeginObject() throws IOException ;

    /**
     * Puts the end of OpenMath object.
     * <p>Prints the end marker of an OpenMath object on output.
     * Must be called each time an OpenMath object is complete.
     * (Not after every token!)
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putEndObject() throws IOException ;


    /**
     * Puts begin of Application.
     *
     * <p>Prints the begining marker of a new Application on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putBeginApplication() throws IOException ;

    /**
     * Puts the end of Application.
     *
     * <p>Prints the end marker of an Application on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putEndApplication() throws IOException ;


    /**
     * Puts begin of Attribution.
     *
     * <p>Prints the begining marker of a new Attribution on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putBeginAttribution() throws IOException ;

    /**
     * Puts the end of Attribution.
     *
     * <p>Prints the end marker of an Attribution on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putEndAttribution() throws IOException ;



    /**
     * Puts begin of attribute-pairs.
     *
     * <p>Prints the begining marker of a new attribute-oairs on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putBeginAttributePairs() throws IOException ;

    /**
     * Puts the end of attribute-pairs.
     *
     * <p>Prints the end marker of an attribute-pairs on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putEndAttributePairs() throws IOException ;


    /**
     * Puts begin of Bind.
     *
     * <p>Prints the begining marker of a new Bind on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putBeginBind() throws IOException ;

    /**
     * Puts the end of Bind.
     *
     * <p>Prints the end marker of a Bind on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putEndBind() throws IOException ;

    /**
     * Puts begin of BVars
     *
     * <p>Prints the begining marker of a new BVars on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putBeginBVars() throws IOException ;

    /**
     * Puts the end of BVars.
     *
     * <p>Prints the end marker of a BVars on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putEndBVars() throws IOException ;

    /**
     * Puts begin of Error.
     *
     * <p>Prints the begining marker of a new Error on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putBeginError() throws IOException ;

    /**
     * Puts the end of Error.
     *
     * <p>Prints the end marker of an Error on output.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putEndError() throws IOException ;


    /**
     * Puts Integer element with its value.
     *
     * <p>Prints a Integer element and its value on the output stream. (if needed assumed base is 10.)
     *
     * @param value the embedded value for this element.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putInteger(int value) throws IOException ;

    /**
     * Puts Integer element with its value.
     *
     * <p>Prints a Integer element and its value on the output stream.
     *
     * @param value the embedded value for this element.
     * @param base the base to use if it is needed (eg: XML). 10 and 16 are supported.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putInteger(int value, int base) throws IOException ;

    /**
     * Puts Integer element with its value.
     *
     * <p>Prints a Integer element and its value on the output stream.
     *
     * @param value the embedded value for this element.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putInteger(BigInteger value) throws IOException ;

    /**
     * Puts a floating-point number element with its value.
     *
     * <p>Prints a floating-point number element and its value on the output stream.
     *
     * @param value the embedded value for this element.
     * @base whether output must be done in hexadecimal of decimal format.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putFloat(double value, int base) throws IOException ;

    /**
     * Puts a floating-point number element with its value.
     *
     * <p>Prints a floating-point number element and its value on the output stream.
     *
     * @param value the embedded value for this element. assumed base is 16
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putFloat(double value) throws IOException ;

    /**
     * Puts String element with its value.
     *
     * <p>Prints a String element and its value on the output stream.
     *
     * @param value the embedded value for this element.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putString(String value) throws IOException ;

    /**
     * Puts Variable element with its value.
     *
     * <p>Prints a Variable element and its value on the output stream.
     *
     * @param name the name for this variable.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putVariable(String name) throws IOException ;

    /**
     * Puts ByteArray element with its value.
     *
     * <p>Prints a ByteArray element and its value on the output stream.
     *
     * @param value the embedded value for this element.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putByteArray(byte[] value) throws IOException ;

    /**
     * Puts Symbol element with its value.
     *
     * <p>Prints a Symbol element and its value on the output stream.
     *
     * @param symbol the symbol definition (CD and name).
     *
     * @exception java.io.IOException Any I/O exception.
     * @see fr.inria.openmath.omapi.Symbol
     */
    public void putSymbol(Symbol symbol) throws IOException ;

    /**
     * Puts Comment element with its value.
     *
     * <p>Prints a Comment element and its value on the output stream.
     *
     * @param the comment content.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putComment(String comment) throws IOException ;


    /**
     * Puts a Processing Instruction with its value.
     *
     * <p>Prints a Processing Instruction and its value on the output stream.
     *
     * @param the comment content.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void putPInstruction(String pi) throws IOException ;


    /**
     * Does what is needed when print has been completed.
     *
     * <p>It must be called when no more print is to be done on this printer.
     *
     * @exception java.io.IOException Any I/O exception.
     */
    public void endPrint() throws IOException ;

}

